from uuid import UUID
from pydantic import BaseModel, Field

class AttachmentBase(BaseModel):
    """附件基础模型"""
    name: str = Field(..., description="附件名称")
    type: str = Field(..., description="附件类型")
    size: int = Field(..., description="附件大小(字节)")

class AttachmentCreate(AttachmentBase):
    """创建附件请求模型"""
    compliance_item_id: UUID = Field(..., description="关联的合规项ID")

class AttachmentInDB(AttachmentBase):
    """数据库中的附件模型"""
    id: UUID
    compliance_item_id: UUID
    path: str

    class Config:
        from_attributes = True

class AttachmentResponse(AttachmentBase):
    """附件响应模型"""
    id: UUID

    class Config:
        from_attributes = True 